package com.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter;
import org.springframework.web.reactive.DispatcherHandler;
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;

@Configuration
public class WebTestConfig {


    @Bean
    public HttpHandler httpHandler() {
        return WebHttpHandlerBuilder.webHandler(new DispatcherHandler())
                // Configure your web handler here
                .build();
    }

    @Bean
    public ReactorHttpHandlerAdapter httpHandlerAdapter(HttpHandler httpHandler) {
        return new ReactorHttpHandlerAdapter(httpHandler);
    }
}
